<?php
require_once __DIR__.'/../../lib/PAutoLoader.php';
use Thrift\Protocol\TBinaryProtocol;
use Thrift\Protocol\TMultiplexedProtocol;
use Thrift\Transport\THttpClient;
use Thrift\Transport\TBufferedTransport;
use Thrift\Exception\TException;
use Swoole\Service\ThriftServiceClient;
try {
    $trans = new THttpClient('localhost', 8080, '');

    $transport = new TBufferedTransport($trans);
    $protocol = new TBinaryProtocol($transport);
    $thriftServiceProtocol = new TMultiplexedProtocol($protocol, 'ThriftService');
//     $thriftServiceClient = new Swoole\Service\ThriftServiceClient($thriftServiceProtocol);
    $thriftServiceClient = new ThriftServiceClient($thriftServiceProtocol);
    $servers = $thriftServiceClient->getServers();

    var_dump($servers);

    //   $transport->close();
} catch (TException $tx) {
    print 'TException: '.$tx->getMessage()."\n";
}

?>